package com.whut.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.whut.entity.Courier;
import com.whut.entity.User;
import com.whut.mapper.UserMapper;
import com.whut.service.UserService;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User>
        implements UserService {
    /**
     * 根据手机号查询用户
     * @param phone
     * @return
     */
    @Override
    public User findByUserPhone(String phone) {
        LambdaQueryWrapper<User> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(User::getUserPhone, phone);
        User user = this.getOne(queryWrapper);
        return user;
    }
}
